use noreturn attribute
authortsteven4 <13596209+tsteven4@users.noreply.github.com>
Sat, 9 Sep 2023 13:32:31 +0000 (07:32 -0600)
committertsteven4 <13596209+tsteven4@users.noreply.github.com>
Sat, 9 Sep 2023 13:32:31 +0000 (07:32 -0600)
jeeps/gpsutil.h
jeeps/jgpsutil.cc
shape.cc
shape.h
unicsv.cc
unicsv.h

index 741d31a5900c0f2b80af205ee1002b422fa7cd61..55ec8b0ba21ec38cb294da25cd32829e211b15f0 100644 (file)
@@ -22,7 +22,7 @@
   void   GPS_Warning(const char* s);
   [[gnu::format(printf, 1, 2)]] void   GPS_Error(const char* fmt, ...);
   [[gnu::format(printf, 1, 2)]] void   GPS_Serial_Error(const char* fmt, ...);
-  void   GPS_Fatal(const char* s);
+  [[noreturn]] void   GPS_Fatal(const char* s);
   void   GPS_Enable_Error();
   void   GPS_Enable_Warning();
   void   GPS_Disable_Error();
index 0f522005fb9d7bdb50218c7d2953f804c0db1f42..a462201af4a300aa049c450540d1ce43f76633b2 100644 (file)
@@ -475,7 +475,7 @@ void GPS_Warning(const char* s)
 ** @@
 ****************************************************************************/
 
-void GPS_Fatal(const char* s)
+[[noreturn]] void GPS_Fatal(const char* s)
 {
 
   fprintf(stderr,"[FATAL] %s\n",s);
index 94321902b87a58e55f6d09e6d5bd76c1a81159cf..318c1a193faf963f9f818833ea8e3365bb38cbc0 100644 (file)
--- a/shape.cc
+++ b/shape.cc
@@ -144,7 +144,7 @@ ShapeFormat::DBFCreateGpsbabel(const QString& pszFilename)
 }
 #endif
 
-void ShapeFormat::dump_fields() const
+[[noreturn]] void ShapeFormat::dump_fields() const
 {
   char name[12];
   warning(MYNAME ": Database fields:\n");
diff --git a/shape.h b/shape.h
index 3d1c0b9f1b38451a5764da28b57e513bdb7e663b..04b59a0dba03d0a00b831dfe3c9bd32785a9224b 100644 (file)
--- a/shape.h
+++ b/shape.h
@@ -65,7 +65,7 @@ private:
   static SHPHandle SHPAPI_CALL SHPCreateGpsbabel(const QString& pszLayer, int nShapeType);
   static DBFHandle SHPAPI_CALL DBFOpenGpsbabel(const QString& pszFilename, const char* pszAccess);
   static DBFHandle SHPAPI_CALL DBFCreateExGpsbabel(const QString& pszFilename, const char* pszCodePage);
-  void dump_fields() const;
+  [[noreturn]] void dump_fields() const;
   void check_field_index(int fieldIdx) const;
   int get_field_index(const QString& fieldName) const;
   void write_wpt(const Waypoint* wpt) const;
index 480616934414240c10c40a0196c56643b09854cf..fd4ee9839d546f06734a15e3d87cca09e1ddc1d0 100644 (file)
--- a/unicsv.cc
+++ b/unicsv.cc
@@ -1078,7 +1078,7 @@ UnicsvFormat::read()
 /* =========================================================================== */
 
 void
-UnicsvFormat::unicsv_fatal_outside(const Waypoint* wpt) const
+[[notreturn]] UnicsvFormat::unicsv_fatal_outside(const Waypoint* wpt) const
 {
   *fout << "#####\n";
   fatal(MYNAME ": %s (%s) is outside of convertible area of grid \"%s\"!\n",
index ce564508d89beac26294a1a6f487295ad86f4704..021e65a898893d55c9c027ce7a8658de6de54a31 100644 (file)
--- a/unicsv.h
+++ b/unicsv.h
@@ -174,7 +174,7 @@ private:
   static bool unicsv_compare_fields(const QString& s, const field_t* f);
   void unicsv_fondle_header(QString header);
   void unicsv_parse_one_line(const QString& ibuf);
-  void unicsv_fatal_outside(const Waypoint* wpt) const;
+  [[noreturn]] void unicsv_fatal_outside(const Waypoint* wpt) const;
   void unicsv_print_str(const QString& s) const;
   void unicsv_print_date_time(const QDateTime& idt) const;
   void unicsv_waypt_enum_cb(const Waypoint* wpt);